/* ---------- AIAgent ----------*/
.ai-agent {
    width: 100%;
    height: 100%;
    display: flex;
    overflow: hidden;
    position: relative;
}
.ai-side-list {
    height: 100%;
    background-color: var(--Colors-Use-Basic-Background);
}
.ai-side-list-mini {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9;
}
.ai-agent-chat {
    flex: 1;
    height: 100%;
    overflow: hidden;
}
.ai-agent-chat-mini {
    padding-left: 26px;
}

/* ---------- AIAgentSideList ----------*/
.ai-agent-side-list {
    height: 100%;
    display: flex;
    border-right: 1px solid var(--Colors-Use-Neutral-Border);
    z-index: 9;

    .side-list-bar {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
        border-right: 1px solid var(--Colors-Use-Neutral-Border);
        background: var(--Colors-Use-Neutral-Bg-Hover);

        .list-item {
            padding: 12px 4px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
            cursor: pointer;
            border-bottom: 1px solid var(--Colors-Use-Neutral-Border);
            position: relative;
            user-select: none;
            .item-title {
                color: var(--Colors-Use-Neutral-Text-1-Title);
                font-size: 12px;
                font-weight: 600;
                line-height: 16px;
                writing-mode: vertical-rl;
                text-orientation: sideways-right;
                transform: rotate(180deg);
            }
            svg {
                width: 16px;
                height: 16px;
                color: var(--Colors-Use-Neutral-Text-3-Secondary);
            }
        }
        .list-item:hover {
            background-color: var(--Colors-Use-Neutral-Border)
        }

        .list-item-active {
            color: var(--Colors-Use-Main-On-Primary);
            background-color: var(--Colors-Use-Main-Primary);
            .item-title {
                color: var(--Colors-Use-Main-On-Primary);
            }
            svg {
                color: var(--Colors-Use-Main-On-Primary);
            }

            &::before {
                position: absolute;
                width: 1px;
                height: 100%;
                content: "";
                top: 0;
                left: -1px;
                background-color: var(--Colors-Use-Main-Primary);
            }
            &::after {
                position: absolute;
                width: 1px;
                height: 100%;
                content: "";
                top: 0;
                right: -1px;
                background-color: var(--Colors-Use-Main-Primary);
            }

            &.list-item:hover {
                    background-color: var(--Colors-Use-Main-Hover);
                &::before {
                    background-color: var(--Colors-Use-Main-Hover);
                }
                &::after {
                    background-color: var(--Colors-Use-Main-Hover);
                }
            }
        }

        .list-item-hidden {
            background-color: var(--Colors-Use-Main-Primary);

            &.list-item-active::before {
                background-color: var(--Colors-Use-Main-Primary);
            }
            &.list-item-active::after {
                background-color: var(--Colors-Use-Main-Primary);
            }

            &.list-item-active.list-item:hover {
                background-color: var(--Colors-Use-Main-Hover);
                &.list-item-active::before {
                    background-color: var(--Colors-Use-Main-Hover);
                }
                &.list-item-active::after {
                    background-color: var(--Colors-Use-Main-Hover);
                }
            }
        }
    }
    .side-list-bar-hidden {
        border-right: 0;
    }

    .side-list-body {
        width: 300px;
        overflow: hidden;
        .active-content {
            width: 100%;
            height: 100%;
        }
        .hidden-content {
            display: none;
        }
    }
    .side-list-body-hidden {
        width: 0;
    }
}

/* ---------- MCPServer ----------*/
.mcp-server {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;

    .servers-header {
        padding: 12px 16px;
        .header-style {
            font-size: 16px;
            color: var(--Colors-Use-Neutral-Text-1-Title);
            font-weight: 600;
        }
        .description-style {
            font-size: 12px;
            color: var(--Colors-Use-Neutral-Text-1-Title);
        }
    }

    .servers-list {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;

        .list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            .header-style {
                padding: 6px 12px;
                font-size: 14px;
                color: var(--Colors-Use-Neutral-Text-1-Title);
            }
        }

        .list-body {
            flex: 1;
            overflow: hidden auto;
            padding: 0 12px 20px;
        }

        .server-item {
            border: 1px solid var(--Colors-Use-Neutral-Border);
            border-radius: 4px;
            padding: 8px;

            .server-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                .header-style {
                    color: var(--Colors-Use-Neutral-Text-1-Title);
                    font-size: 14px;
                    font-weight: 600;
                    line-height: 20px;
                }
            }
            .server-content {
                color: #b4bbca;
                font-size: 12px;
                line-height: 20px;
                margin-top: 8px;
                .line-style {
                    width: 100%;
                    overflow: hidden;
                }
            }
            .server-footer {
                margin-top: 8px;
                display: flex;
                justify-content: space-between;
                align-items: center;
                .btn-group {
                    display: flex;
                    align-items: center;
                    justify-content: right;
                    gap: 4px;
                }
            }
        }
        .server-wrapper:not(:first-child) {
            margin-top: 12px;
        }
    }
}

/* ---------- ServerInfoModal ----------*/
.server-info {
    padding: 0 12px 12px 12px;
    .header {
        display: flex;
        align-items: center;
    }
    .content {
        margin-top: 16px;
        height: 60vh;
        overflow: hidden;
        .active-content {
            height: 100%;
            overflow: hidden auto;
        }
        .hidden-content {
            display: none;
        }

        .tools-wrapper {
            display: flex;
            flex-direction: column;
            overflow-y: hidden;
            .tools-body {
                margin-top: 12px;
                flex: 1;
                overflow: hidden auto;
            }
        }
        .hidden-content.tools-wrapper {
            display: none;
        }

        .tools-item {
            .name {
                .icon-style {
                    margin-right: 4px;
                    svg {
                        width: 16px;
                        height: 16px;
                    }
                }
                font-size: 16px;
                color: var(--Colors-Use-Neutral-Text-1-Title);
                font-weight: 600;
                line-height: 20px;
            }
            .description {
                margin-top: 6px;
                color: #b4bbca;
                font-size: 12px;
                line-height: 16px;
            }
            .params {
                margin-top: 4px;
                padding: 4px;
                border: 1px solid var(--Colors-Use-Neutral-Border);
                border-radius: 4px;
                .param-item {
                    .item-info {
                        display: flex;
                        align-items: center;
                        .required {
                            color: var(--Colors-Use-Error-Primary);
                        }
                        .key-style {
                            overflow: hidden;
                            font-size: 14px;
                            color: var(--Colors-Use-Main-Primary);
                            line-height: 20px;
                        }
                        .type-style {
                            margin-left: 6px;
                        }
                        .notes-icon {
                            cursor: pointer;
                            margin-left: 6px;
                            color: var(--Colors-Use-Neutral-Text-4-Help-text);
                            svg {
                                width: 16px;
                                height: 16px;
                            }
                        }
                    }
                    .item-description {
                        color: #b4bbca;
                        font-size: 12px;
                    }
                }
                .param-item:not(:first-child) {
                    margin-top: 8px;
                }
            }
        }
        .tools-item:not(:first-child) {
            margin-top: 16px;
        }

        .resource-template-item {
            padding: 4px;
            border: 1px solid var(--Colors-Use-Neutral-Border);
            border-radius: 4px;
            .uri {
                .icon-style {
                    margin-right: 4px;
                    svg {
                        width: 16px;
                        height: 16px;
                    }
                }
                font-size: 16px;
                color: var(--Colors-Use-Neutral-Text-1-Title);
                font-weight: 600;
                line-height: 20px;
            }
            .name {
                margin-top: 6px;
                color: #b4bbca;
                font-size: 12px;
                line-height: 16px;
            }
        }
        .resource-template-item:not(:first-child) {
            margin-top: 8px;
        }
    }
}
.param-notes-wrapper {
    width: 40vw;
    /* 行内代码样式 */
    code {
        font-family: monospace;
        background-color: rgba(175, 184, 193, 0.2);
        color: #24292f;
        padding: 2px 4px;
        border-radius: 3px;
        border: 1px solid #ddd;
        font-size: 0.9em;
    }

    /* 代码块样式 */
    pre {
        background-color: #f6f8fa;
        padding: 1em;
        border-radius: 5px;
        border: 1px solid #d0d7de;
        font-size: 0.9em;
        line-height: 1.5;
        white-space: pre-wrap;
        word-break: break-word;
        overflow-wrap: break-word;
        height: 30vh;
        overflow-y: auto;
        position: relative;
    }

    pre code {
        background-color: transparent;
        padding: 0;
        border: 0;
        font-size: inherit;
    }

    .copy-icon {
        position: absolute;
        top: 6px;
        right: 4px;
        width: 16px;
        height: 16px;
        .icon-style {
            margin-left: 0;
        }
    }
}
